<?php

/**
 * 
 * @version $Id: Reserva.php 40 2012-08-14 03:32:52Z joaopaulopvillela@gmail.com $
 */
class Default_Form_Reserva extends Zend_Form {

    public function init() {
        
        $this->setMethod( Zend_Form::METHOD_POST );
        $this->setEnctype( Zend_Form::ENCTYPE_MULTIPART );

        $this->setAttrib( 'class', 'form' );
        $this->setAttrib( 'id', 'form-reserva' );
//        $this->setAttrib( 'target', 'upload_target' );
        $this->setAttrib( 'onSubmit', 'return save(this);' );

        $elements = array();

        $decorator = array('ViewHelper');

        $elements[] = $this->createElement('text', 'res_nome')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->setAttrib('maxlength', 150)
                ->setAttrib('class', 'text')
                ->setRequired(true);

        $elements[] = $this->createElement('text', 'res_email')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->addValidator('EmailAddress')
                ->setAttrib('maxlength', 100)
                ->setAttrib('class', 'text')
                ->setRequired(true);

        $elements[] = $this->createElement('text', 'res_telefone')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->setAttrib('maxlength', 20)
                ->addFilter('StringTrim')
                ->setAttrib('class', 'textsmal')
                ->setRequired(false);

        $elements[] = $this->createElement('text', 'res_celular')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->setAttrib('maxlength', 20)
                ->addFilter('StringTrim')
                ->setAttrib('class', 'textsmal')
                ->setRequired(false);

        $elements[] = $this->createElement('text', 'res_destino')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->setAttrib('maxlength', 150)
                ->addFilter('StringTrim')
                ->setAttrib('class', 'text')
                ->setRequired(true);

        $elements[] = $this->createElement('text', 'res_qtdadulto')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->setAttrib('maxlength', 2)
                ->addFilter('StringTrim')
                ->setAttrib('class', 'textsmal')
                ->setRequired(false);

        $elements[] = $this->createElement('text', 'res_qtdcrianca')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->setAttrib('maxlength', 2)
                ->addFilter('StringTrim')
                ->setAttrib('class', 'textsmal')
                ->setRequired(false);

        $elements[] = $this->createElement('textarea', 'res_obs')
                ->setDecorators($decorator)
                ->addFilter('StripTags')
                ->setAttrib('rows', 4)
                ->setAttrib('cols', 50)
                ->setRequired(false);

        $this->setElements($elements);
    }

}